# Author:sp
# CreaTime: $(DATE)
# FileName: $(NAME)
# Description: simple introdution of the code
lst=[]
for i in range(0,2):
    goods=input('请输入商品的编号和商品名称：')
    lst.append(goods)
print(lst)
car = []                         #这为什么要放到外面
while True:
    get_num = input('请输入你想要选购的商品编号：')   #这个为什么放到这
    for item in lst:
        if item.find(get_num)!=-1:
            car.append(item)
            break
    if get_num=='quit':
       break
#for j in car[len(car),-1,-1]:
#for i in range(len(car),-1,-1):         IndexError: list index out of range
for i in range(len(car)-1, -1, -1):
    print(car[i])
